#@weiXinLayout("绑定帐号信息")

#define weiXinCss()
<style>
    .loginFormContainer{
        height: 100%;
        justify-content: center;
        margin: 80px;
    }
    .title{
        color: #6C3428;
    }

    .wx-login{
        margin-top:80px;
        color: white;
    }

    body {
        height: 100%;
        width: 100%;
        background: url('#(contextPath)/assets/front/img/wx-login-bg.jpeg') no-repeat center center fixed;
        background-size:cover;
    }
</style>
#end

#define weiXinMain()

<div class="loginFormContainer">
    <div style="text-align: center">
        <div class="title">
            <img src="#(member.avatar??'')" class="icon-avatar-48">
            <p>欢迎您，#(member.nick_name??'')</p>
        </div>
        <div class="weui-cells">
            <div class="weui-cell">
                <div class="weui-cell__bd">
                    <input class="weui-input" id="mobile" type="text" placeholder="请设置当前账户的手机号...">
                </div>
            </div>
        </div>
        <div class="weui-cells">
            <div class="weui-cell">
                <div class="weui-cell__bd">
                    <input class="weui-input" type="password" id="password" placeholder="请设置当前账户的密码...">
                </div>
            </div>
        </div>
        <div class="weui-cells">
            <div class="weui-cell">
                <div class="weui-cell__bd">
                    <input class="weui-input" type="password" id="confirmPassWord"  placeholder="请再次确认当前账户的密码...">
                </div>
            </div>
        </div>
        <div style="margin-top:20px;">
            <a href="javascript:;" id="updateBtn"class="weui-btn weui-btn_primary">点我提交绑定信息</a>
        </div>
    </div>
</div>
#end
#define weiXinJs()
<script>
$(document).ready(function(){

    $("#updateBtn").click(function(){
        $.confirm({
            "title":"系统提示",
            "text":"请检查是否已经正确设置了信息？",
            "onOK":function(){
                var config ={
                    "url":"#(contextPath)/weixin/doUpdateMemberSet",
                    "data":{
                        "mobile":$("#mobile").val(),
                        "password":$("#password").val(),
                        "confirmPassWord":$("#confirmPassWord").val(),
                        "id":"#(member.id??'0')"
                    },
                    "successCallBack":function(resp){
                        if(resp.result){
                            $.alert(resp.data,function(){
                                window.location.href="#(contextPath)/weixin/"
                            })
                        }else{
                            $.alert(resp.data);
                        }
                    }
                }
                var ajax = new AjaxUtils(config);
                ajax.executeRequest();
            }
        })
    });


});
</script>
#end